<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>更改 HTML 元素的内容为 JavaScript 表达式的值</title>
</head>
<body>
<div id="change" class="change">
  <h1>{{ i + 456 }}</h1>
  <div>{{ info.toUpperCase() }}</div>
</div>
</body>
<script>
  let i = 123
  let info = "Hello, World!"

  let element = document.querySelector("#change > h1");
  console.log(element);
  console.log(element.textContent);

  console.log(eval(element.textContent));
  element.textContent = eval(element.textContent)

  let selector = document.querySelector("#change > div");
  selector.textContent = eval(selector.textContent)

</script>
</html>